<?php
	$dom = new DOMDocument();
	$dom->loadHTMLFile($file_loc);
	$images = $dom->getElementsByTagName('img');
?>
<div id="artifacts-display-area">
	<div class="page-spanner">Save Artifact &gt; <strong>Publish Artifact</strong> &gt; Broadcast News</div>
	<form enctype="multipart/form-data"  action="<?php echo $config_file['web_root']?>/php/admin/artifact_admin.php" method="post" target="upload_target">
		<input type="hidden" name="func" value="P">
		<input type="hidden" name="artifact-type" value="<?php echo $artifact_type?>">
		<input type="hidden" name="artifact-title" value="<?php echo $title?>">
		<input type="hidden" name="artifact-id" value="<?php echo $artifact_id?>">
		<input type="hidden" name="news" value="<?php echo $news?>">
		<input type="hidden" name="url" value="<?php echo $url?>">
	<div class="page-spanner">
		<table id="form-table" border="0" align="left" cellspacing="0" cellpadding="0">
			<tr>
				<td><span class="form-field">Artifact: <?php echo $title?></span></td>
			</tr>
			<tr>
				<td><span class="form-field">Select images</td>
			</tr>
		<?php
				$i = 0;
				foreach ($images as $img) {
					if ($img->getAttribute("class") == "zoomable") {
					$i = $i + 1;
		?>
			<tr>
				<td>
					<span class="form-field">Image <?php echo $i?>: <?php echo $img->getAttribute("src")?>: <input name="img<?php echo $i?>" id="img<?php echo $i?>" type="file" class="file-upload"/></span>
				</td>
			</tr>
		
		<?php
					}
				}
		?>
			
			<tr><td><span class="form-field"><input type="submit" id="submit-button" class="active" name="submit" onclick="inactivate(this)" value="Publish"/></span></td></tr>
		</table>
	</div>
		<input type="hidden" name="img-count" value="<?php echo $i?>">
	</form>
	<iframe id="upload_target" name="upload_target" src="#"></iframe>
</div>
<script type="text/javascript">
parent.artifactUpdateCallback(document.body.innerHTML);
</script>
